status = 404
match status:
    case 200:
        print('成功')
    case 404:
        print('未找到')
    case  500:
        print('服务器错误')
    case _:
        print('未知状态码')

#多值匹配
command = "左"

match command:
    case "上" | "下" | "左" | "右":
        print("方向指令")
    case "开始" | "暂停" | "继续":
        print("控制指令")
    case _:
        print("未知指令")

point = (3, 4)

match point:
    case (0, 0):
        print("原点")
    case (x, 0):
        print(f"在X轴上，x={x}")
    case (0, y):
        print(f"在Y轴上，y={y}")
    case (x, y):
        print(f"在坐标({x}, {y})")

